package org.gesplan.entity.sig;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author David
 */
@Entity
@Table(name = "xarxa_fluvial_temp")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "XarxaFluvial.findAll", query = "SELECT e FROM XarxaFluvial e ORDER BY e.codi"),
    @NamedQuery(name = "XarxaFluvial.findByCodiCami", query = "SELECT e FROM XarxaFluvial e WHERE e.codi = :codi")
})
public class XarxaFluvial implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "codi")
    private String codi;
    @Column(name = "nom")
    private String nom;


    public XarxaFluvial() {
    }


    public XarxaFluvial(String codi) {
        this.codi = codi;
    }


    public String getCodi() {
        return codi;
    }


    public void setCodi(String codi) {
        this.codi = codi;
    }

    
    public String getNom() {
        return nom;
    }


    public void setNom(String nom) {
        this.nom = nom;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codi != null ? codi.hashCode() : 0);
        return hash;
    }


    @Override
    public boolean equals(Object object) {
        if (!(object instanceof XarxaFluvial)) {
            return false;
        }
        XarxaFluvial other = (XarxaFluvial) object;
        return (this.codi != null || other.codi == null) && (this.codi == null || this.codi.equals(other.codi));
    }


    @Override
    public String toString() {
        return codi + " - " + nom;
    }
    
    
}